﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PostAtt.ascx.cs" Inherits="NhanAi.Admin.PostAtts" %>
<script type="text/javascript">
    //require jquery library
    $(document).ready(function(){

        var status=<%= PostAtt %>;
        if((status&1)==1) {
            $('#new-post').attr('checked','checked');
            $('#new-post').next().attr('class','ui-checkbox ui-checkbox-state-checked');
        }
        if((status&2)==2) {
            $('#featured-post').attr('checked','checked');
            $('#featured-post').next().attr('class','ui-checkbox ui-checkbox-state-checked');
        }
    

        $('input[type="checkbox"]').click(function(){
            var status=0;
            if($('#new-post').is(':checked')) status+=1;
            if($('#featured-post').is(':checked')) status+=2;
          
            $('#ThuocTinh').val(status);
        });
    });
     
</script>
<input type="hidden" name="ThuocTinh" id="ThuocTinh" value="<%=PostAtt %>" />
<table>
    
    <tr>
        <td><input type="checkbox" name="new" id="new-post"</td>
        <td>Bài viết mới</td>
    </tr>
    <tr>        
        <td><input type="checkbox" name="featured" id="featured-post"/></td>
        <td>Bài viết nổi bật</td>
    </tr>   
</table>